<?php
include "../librari/koneksi.php";

	
  $id=$_POST['id'];
  $nama=$_POST['nama'];
  $bobot=$_POST['bobot'];
  


 if($id!="" && $nama!="" && $bobot!=""){
 $sql = "INSERT INTO tes set idTes='".$_POST['id']."',
 									nmTes='".$_POST['nama']."',
									bobot='".$_POST['bobot']."'"
									;

								
mysql_query($sql)
or die ("Gagal query simpan: ".mysql_error());
}


 if($id =="" || $nama =="" || $bobot ==""){
 echo "<script language='JavaScript'>document.location='tes.php';
alert('Ada data yang belum diisi. Silahkan Ulangi Kembali.   --".$id."--".$nama."--".$bobot."  Klik OK!');
 </script>"; }
 
 echo "<script language='JavaScript'>document.location='tes.php?id=$id';
alert('Sukses. Klik OK!');
 </script>";
	
			
?>